/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-03-12
 * Time: 14:02
 */
class Solution1 {
    public int firstUniqChar(String s) {
        int[] count = new int[26];
        for(int i =0;i<s.length();i++){
            char ch = s.charAt(i);
            count[ch-'a']++;
        }
        for(int i =0;i<s.length();i++){
            char ch = s.charAt(i);
            if(count[ch-'a']==1){
                return i;
            }
        }
        return -1;
    }
}
public class Test {

    public static void main(String[] args) {
        String str1 = "hello";
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(str1);
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i < 10; i++) {
            stringBuilder.append(i);
        }
        System.out.println(stringBuilder);
    }

}
